package com.adtech.farmProducts.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Time:2020/6/12
 * Created by xiaocz
 * Describe 广告
 */
public class Advertising implements Parcelable {

    /**
     * id : 4
     * imgurl : http://admin.mtydj.com:80/files/20200611/20200611114705thumbnail.jpg
     * href : http://h5.mtydj.com/AD/Index/2
     * position : 1
     */

    private int id;
    @SerializedName("imgurl")
    private String imgUrl;
    private String href;
    private int position;

    protected Advertising(Parcel in) {
        id = in.readInt();
        imgUrl = in.readString();
        href = in.readString();
        position = in.readInt();
    }

    public static final Creator<Advertising> CREATOR = new Creator<Advertising>() {
        @Override
        public Advertising createFromParcel(Parcel in) {
            return new Advertising(in);
        }

        @Override
        public Advertising[] newArray(int size) {
            return new Advertising[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    @Override
    public String toString() {
        return "Advertising{" +
                "id=" + id +
                ", imgUrl='" + imgUrl + '\'' +
                ", href='" + href + '\'' +
                ", position=" + position +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(imgUrl);
        dest.writeString(href);
        dest.writeInt(position);
    }
}
